origin = 0


def factory(pos):
    def go(step):
        nonlocal pos
        new_pow = pos+step
        pos = new_pow
        return new_pow
    return go


tourist = factory(origin)
print(tourist(2))
print(tourist(3))
print(tourist(5))
